home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / SpeechRecognition.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  26.3 KB  |  758 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SpeechRecognition.a
  3. ;
  4. ;    Contains:    Apple Speech Recognition Toolbox Interfaces.
  5. ;
  6. ;    Version:    Technology:    PlainTalk 1.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1992-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
  19. __SPEECHRECOGNITION__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28. ;  Error Codes [Speech recognition gets -5100 through -5199] 
  29.  
  30. kSRNotAvailable                    EQU        -5100                ; the service requested is not avail or applicable 
  31. kSRInternalError                EQU        -5101                ; a system internal or hardware error condition 
  32. kSRComponentNotFound            EQU        -5102                ; a needed system resource was not located 
  33. kSROutOfMemory                    EQU        -5103                ; an out of memory error occurred in the toolbox memory space 
  34. kSRNotASpeechObject                EQU        -5104                ; the object specified is no longer or never was valid 
  35. kSRBadParameter                    EQU        -5105                ; an invalid parameter was specified 
  36. kSRParamOutOfRange                EQU        -5106                ; when we say 0-100, don't pass in 101. 
  37. kSRBadSelector                    EQU        -5107                ; an unrecognized selector was specified 
  38. kSRBufferTooSmall                EQU        -5108                ; returned from attribute access functions 
  39. kSRNotARecSystem                EQU        -5109                ; the object used was not a SRRecognitionSystem 
  40. kSRFeedbackNotAvail                EQU        -5110                ; there is no feedback window associated with SRRecognizer 
  41. kSRCantSetProperty                EQU        -5111                ; a non-settable property was specified 
  42. kSRCantGetProperty                EQU        -5112                ; a non-gettable property was specified 
  43. kSRCantSetDuringRecognition        EQU        -5113                ; the property can't be set while recognition is in progress -- do before or between utterances. 
  44. kSRAlreadyListening                EQU        -5114                ; in response to SRStartListening 
  45. kSRNotListeningState            EQU        -5115                ; in response to SRStopListening 
  46. kSRModelMismatch                EQU        -5116                ; no acoustical models are avail to match request 
  47. kSRNoClientLanguageModel        EQU        -5117                ; trying to access a non-specified SRLanguageModel 
  48. kSRNoPendingUtterances            EQU        -5118                ; nothing to continue search on 
  49. kSRRecognitionCanceled            EQU        -5119                ; an abort error occurred during search 
  50. kSRRecognitionDone                EQU        -5120                ; search has finished, but nothing was recognized 
  51. kSROtherRecAlreadyModal            EQU        -5121                ; another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now 
  52. kSRHasNoSubItems                EQU        -5122                ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. 
  53. kSRSubItemNotFound                EQU        -5123                ; returned when accessing a non-existent sub item of a container 
  54. kSRLanguageModelTooBig            EQU        -5124                ; Cant build language models so big 
  55. kSRAlreadyReleased                EQU        -5125                ; this object has already been released before 
  56. kSRAlreadyFinished                EQU        -5126                ; the language model can't be finished twice 
  57. kSRWordNotFound                    EQU        -5127                ; the spelling couldn't be found in lookup(s) 
  58. kSRNotFinishedWithRejection        EQU        -5128                ; property not found because the LMObj is not finished with rejection 
  59. kSRExpansionTooDeep                EQU        -5129                ; Language model is left recursive or is embedded too many levels 
  60. kSRTooManyElements                EQU        -5130                ; Too many elements added to phrase or path or other langauge model object 
  61. kSRCantAdd                        EQU        -5131                ; Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    
  62. kSRSndInSourceDisconnected        EQU        -5132                ; Sound input source is disconnected 
  63. kSRCantReadLanguageObject        EQU        -5133                ; An error while trying to create new Language object from file or pointer -- possibly bad format 
  64.                                                             ; non-release debugging error codes are included here 
  65. kSRNotImplementedYet            EQU        -5199                ; you'd better wait for this feature in a future release 
  66.  
  67. ;  Type Definitions 
  68.  
  69.  
  70. ; typedef SRSpeechObject                 SRRecognitionSystem
  71.  
  72. ; typedef SRSpeechObject                 SRRecognizer
  73.  
  74. ; typedef SRSpeechObject                 SRSpeechSource
  75.  
  76. ; typedef SRSpeechSource                 SRRecognitionResult
  77.  
  78. ; typedef SRSpeechObject                 SRLanguageObject
  79.  
  80. ; typedef SRLanguageObject                 SRLanguageModel
  81.  
  82. ; typedef SRLanguageObject                 SRPath
  83.  
  84. ; typedef SRLanguageObject                 SRPhrase
  85.  
  86. ; typedef SRLanguageObject                 SRWord
  87.  
  88. ;  between 0 and 100 
  89. ; typedef unsigned short                 SRSpeedSetting
  90.  
  91. ;  between 0 and 100 
  92. ; typedef unsigned short                 SRRejectionLevel
  93.  
  94. ;  When an event occurs, the user supplied proc will be called with a pointer    
  95. ;     to the param passed in and a flag to indicate conditions such                
  96. ;     as interrupt time or system background time.                                
  97. SRCallBackStruct        RECORD 0
  98. what                     ds.l    1                ; offset: $0 (0)        ;  one of notification flags 
  99. message                     ds.l    1                ; offset: $4 (4)        ;  contains SRRecognitionResult id 
  100. instance                 ds.l    1                ; offset: $8 (8)        ;  ID of recognizer being notified 
  101. status                     ds.w    1                ; offset: $C (12)        ;  result status of last search 
  102. flags                     ds.w    1                ; offset: $E (14)        ;  non-zero if occurs during interrupt 
  103. refCon                     ds.l    1                ; offset: $10 (16)        ;  user defined - set from SRCallBackParam 
  104. sizeof                     EQU *                    ; size:   $14 (20)
  105.                         ENDR
  106. ;  Call back procedure definition 
  107. SRCallBackParam            RECORD 0
  108. callBack                 ds.l    1                ; offset: $0 (0)
  109. refCon                     ds.l    1                ; offset: $4 (4)
  110. sizeof                     EQU *                    ; size:   $8 (8)
  111.                         ENDR
  112. ;  Recognition System Types 
  113.  
  114. kSRDefaultRecognitionSystemID    EQU        0
  115. ;  Recognition System Properties 
  116.  
  117. kSRFeedbackAndListeningModes    EQU        'fbwn'                ; short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes 
  118. kSRRejectedWord                    EQU        'rejq'                ; the SRWord used to represent a rejection 
  119. kSRCleanupOnClientExit            EQU        'clup'                ; Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits 
  120.  
  121. kSRNoFeedbackNoListenModes        EQU        0                    ; next allocated recognizer has no feedback window and doesn't use listening modes    
  122. kSRHasFeedbackHasListenModes    EQU        1                    ; next allocated recognizer has feedback window and uses listening modes             
  123. kSRNoFeedbackHasListenModes        EQU        2                    ; next allocated recognizer has no feedback window but does use listening modes     
  124. ;  Speech Source Types 
  125.  
  126. kSRDefaultSpeechSource            EQU        0
  127. kSRLiveDesktopSpeechSource        EQU        'dklv'                ; live desktop sound input 
  128. kSRCanned22kHzSpeechSource        EQU        'ca22'                ; AIFF file based 16 bit, 22.050 KHz sound input 
  129. ;  Notification via Apple Event or Callback 
  130. ;  Notification Flags 
  131.  
  132. kSRNotifyRecognitionBeginning    EQU        $00000001            ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition 
  133. kSRNotifyRecognitionDone        EQU        $00000002            ; recognition has terminated. result (if any) is available. 
  134. ;  Apple Event selectors 
  135. ;  AppleEvent message class  
  136.  
  137. kAESpeechSuite                    EQU        'sprc'
  138. ;  AppleEvent message event ids 
  139.  
  140. kAESpeechDone                    EQU        'srsd'
  141. kAESpeechDetected                EQU        'srbd'
  142. ;  AppleEvent Parameter ids 
  143.  
  144. keySRRecognizer                    EQU        'krec'
  145. keySRSpeechResult                EQU        'kspr'
  146. keySRSpeechStatus                EQU        'ksst'
  147. ;  AppleEvent Parameter types 
  148.  
  149. typeSRRecognizer                EQU        'trec'
  150. typeSRSpeechResult                EQU        'tspr'
  151.  
  152. ;  SRRecognizer Properties 
  153.  
  154. kSRNotificationParam            EQU        'noti'                ; see notification flags below 
  155. kSRCallBackParam                EQU        'call'                ; type SRCallBackParam 
  156. kSRSearchStatusParam            EQU        'stat'                ; see status flags below 
  157. kSRAutoFinishingParam            EQU        'afin'                ; automatic finishing applied on LM for search 
  158. kSRForegroundOnly                EQU        'fgon'                ; Boolean. Default is true. If true, client recognizer only active when in foreground.    
  159. kSRBlockBackground                EQU        'blbg'                ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    
  160. kSRBlockModally                    EQU        'blmd'                ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! 
  161. kSRWantsResultTextDrawn            EQU        'txfb'                ; Boolean. Default is true. If true, search results are posted to Feedback window 
  162. kSRWantsAutoFBGestures            EQU        'dfbr'                ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior 
  163. kSRSoundInVolume                EQU        'volu'                ; short in [0..100] log scaled sound input power. Can't set this property 
  164. kSRReadAudioFSSpec                EQU        'aurd'                ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF 
  165. kSRCancelOnSoundOut                EQU        'caso'                ; Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. 
  166. kSRSpeedVsAccuracyParam            EQU        'sped'                ; SRSpeedSetting between 0 and 100 
  167. ;  0 means more accurate but slower. 
  168. ;  100 means (much) less accurate but faster. 
  169.  
  170. kSRUseToggleListen                EQU        0                    ; listen key modes 
  171. kSRUsePushToTalk                EQU        1
  172.  
  173. kSRListenKeyMode                EQU        'lkmd'                ; short: either kSRUseToggleListen or kSRUsePushToTalk 
  174. kSRListenKeyCombo                EQU        'lkey'                ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message 
  175. kSRListenKeyName                EQU        'lnam'                ; Str63: string representing ListenKeyCombo 
  176. kSRKeyWord                        EQU        'kwrd'                ; Str255: keyword preceding spoken commands in kSRUseToggleListen mode 
  177. kSRKeyExpected                    EQU        'kexp'                ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? 
  178. ;  Operational Status Flags 
  179.  
  180. kSRIdleRecognizer                EQU        $00000001            ; engine is not active 
  181. kSRSearchInProgress                EQU        $00000002            ; search is in progress 
  182. kSRSearchWaitForAllClients        EQU        $00000004            ; search is suspended waiting on all clients' input 
  183. kSRMustCancelSearch                EQU        $00000008            ; something has occurred (sound played, non-speech detected) requiring the search to abort 
  184. kSRPendingSearch                EQU        $00000010            ; we're about to start searching 
  185. ;  Recognition Result Properties 
  186.  
  187. kSRTEXTFormat                    EQU        'TEXT'                ; raw text in user supplied memory 
  188. kSRPhraseFormat                    EQU        'lmph'                ; SRPhrase containing result words 
  189. kSRPathFormat                    EQU        'lmpt'                ; SRPath containing result phrases or words 
  190. kSRLanguageModelFormat            EQU        'lmfm'                ; top level SRLanguageModel for post parse 
  191. ;  SRLanguageObject Family Properties 
  192.  
  193. kSRSpelling                        EQU        'spel'                ; spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel 
  194. kSRLMObjType                    EQU        'lmtp'                ; Returns one of SRLanguageObject Types listed below 
  195. kSRRefCon                        EQU        'refc'                ; 4 bytes of user storage 
  196. kSROptional                        EQU        'optl'                ; Boolean -- true if SRLanguageObject is optional    
  197. kSREnabled                        EQU        'enbl'                ; Boolean -- true if SRLanguageObject enabled 
  198. kSRRepeatable                    EQU        'rptb'                ; Boolean -- true if SRLanguageObject is repeatable 
  199. kSRRejectable                    EQU        'rjbl'                ; Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord 
  200.                                                             ;        object can be returned in place of SRLanguageObject with this property)    
  201. kSRRejectionLevel                EQU        'rjct'                ; SRRejectionLevel between 0 and 100 
  202. ;  LM Object Types -- returned as kSRLMObjType property of language model objects 
  203.  
  204. kSRLanguageModelType            EQU        'lmob'                ; SRLanguageModel 
  205. kSRPathType                        EQU        'path'                ; SRPath 
  206. kSRPhraseType                    EQU        'phra'                ; SRPhrase 
  207. kSRWordType                        EQU        'word'                ; SRWord 
  208. ;  a normal and reasonable rejection level 
  209.  
  210. kSRDefaultRejectionLevel        EQU        50
  211. ; *******************************************************************************
  212. ;                         NOTES ON USING THE API                                    
  213. ;                                                                                 
  214. ;         All operations (with the exception of SRGetRecognitionSystem) are        
  215. ;         directed toward an object allocated or begot from New, Get and Read        
  216. ;         type calls.                                                                
  217. ;                                                                                 
  218. ;         There is a simple rule in dealing with allocation and disposal:            
  219. ;                                                                                 
  220. ;         *    all toolbox allocations are obtained from a SRRecognitionSystem        
  221. ;                                                                                 
  222. ;         *    if you obtain an object via New or Get, then you own a reference     
  223. ;             to that object and it must be released via SRReleaseObject when        
  224. ;             you no longer need it                                                
  225. ;                                                                                 
  226. ;         *    when you receive a SRRecognitionResult object via AppleEvent or        
  227. ;             callback, it has essentially been created on your behalf and so        
  228. ;             you are responsible for releasing it as above                        
  229. ;                                                                                 
  230. ;         *    when you close a SRRecognitionSystem, all remaining objects which        
  231. ;             were allocated with it will be forcefully released and any            
  232. ;             remaining references to those objects will be invalid.                
  233. ;                                                                                 
  234. ;         This translates into a very simple guideline:                            
  235. ;             If you allocate it or have it allocated for you, you must release    
  236. ;             it.  If you are only peeking at it, then don't release it.            
  237. ;                                                                                 
  238. ; *******************************************************************************
  239. ;  Opening and Closing of the SRRecognitionSystem 
  240. ;
  241. ; pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  244.         Macro
  245.         _SROpenRecognitionSystem
  246.             move.w              #$0400,D0
  247.             dc.w                $AA56
  248.         EndM
  249.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION SROpenRecognitionSystem
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  257.         Macro
  258.         _SRCloseRecognitionSystem
  259.             move.w              #$0201,D0
  260.             dc.w                $AA56
  261.         EndM
  262.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION SRCloseRecognitionSystem
  264.     ENDIF
  265.  
  266. ;  Accessing Properties of any Speech Object 
  267. ;
  268. ; pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  271.         Macro
  272.         _SRSetProperty
  273.             move.w              #$0802,D0
  274.             dc.w                $AA56
  275.         EndM
  276.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION SRSetProperty
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  284.         Macro
  285.         _SRGetProperty
  286.             move.w              #$0803,D0
  287.             dc.w                $AA56
  288.         EndM
  289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION SRGetProperty
  291.     ENDIF
  292.  
  293. ;  Any object obtained via New or Get type calls must be released 
  294. ;
  295. ; pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  296. ;
  297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  298.         Macro
  299.         _SRReleaseObject
  300.             move.w              #$0204,D0
  301.             dc.w                $AA56
  302.         EndM
  303.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  304.         IMPORT_CFM_FUNCTION SRReleaseObject
  305.     ENDIF
  306.  
  307. ;
  308. ; pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  309. ;
  310.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  311.         Macro
  312.         _SRGetReference
  313.             move.w              #$0425,D0
  314.             dc.w                $AA56
  315.         EndM
  316.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION SRGetReference
  318.     ENDIF
  319.  
  320. ;  SRRecognizer Instance Functions 
  321. ;
  322. ; pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *recognizer, OSType sourceID)
  323. ;
  324.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  325.         Macro
  326.         _SRNewRecognizer
  327.             move.w              #$060A,D0
  328.             dc.w                $AA56
  329.         EndM
  330.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  331.         IMPORT_CFM_FUNCTION SRNewRecognizer
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal OSErr SRStartListening(SRRecognizer recognizer)
  336. ;
  337.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  338.         Macro
  339.         _SRStartListening
  340.             move.w              #$020C,D0
  341.             dc.w                $AA56
  342.         EndM
  343.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  344.         IMPORT_CFM_FUNCTION SRStartListening
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal OSErr SRStopListening(SRRecognizer recognizer)
  349. ;
  350.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  351.         Macro
  352.         _SRStopListening
  353.             move.w              #$020D,D0
  354.             dc.w                $AA56
  355.         EndM
  356.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION SRStopListening
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal OSErr SRSetLanguageModel(SRRecognizer recognizer, SRLanguageModel languageModel)
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  364.         Macro
  365.         _SRSetLanguageModel
  366.             move.w              #$040E,D0
  367.             dc.w                $AA56
  368.         EndM
  369.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION SRSetLanguageModel
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal OSErr SRGetLanguageModel(SRRecognizer recognizer, SRLanguageModel *languageModel)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  377.         Macro
  378.         _SRGetLanguageModel
  379.             move.w              #$040F,D0
  380.             dc.w                $AA56
  381.         EndM
  382.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  383.         IMPORT_CFM_FUNCTION SRGetLanguageModel
  384.     ENDIF
  385.  
  386. ;
  387. ; pascal OSErr SRContinueRecognition(SRRecognizer recognizer)
  388. ;
  389.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  390.         Macro
  391.         _SRContinueRecognition
  392.             move.w              #$0210,D0
  393.             dc.w                $AA56
  394.         EndM
  395.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  396.         IMPORT_CFM_FUNCTION SRContinueRecognition
  397.     ENDIF
  398.  
  399. ;
  400. ; pascal OSErr SRCancelRecognition(SRRecognizer recognizer)
  401. ;
  402.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  403.         Macro
  404.         _SRCancelRecognition
  405.             move.w              #$0211,D0
  406.             dc.w                $AA56
  407.         EndM
  408.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  409.         IMPORT_CFM_FUNCTION SRCancelRecognition
  410.     ENDIF
  411.  
  412. ;
  413. ; pascal OSErr SRIdle(void )
  414. ;
  415.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  416.         Macro
  417.         _SRIdle
  418.             move.w              #$0028,D0
  419.             dc.w                $AA56
  420.         EndM
  421.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  422.         IMPORT_CFM_FUNCTION SRIdle
  423.     ENDIF
  424.  
  425. ;  Language Model Building and Manipulation Functions 
  426. ;
  427. ; pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  430.         Macro
  431.         _SRNewLanguageModel
  432.             move.w              #$0812,D0
  433.             dc.w                $AA56
  434.         EndM
  435.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  436.         IMPORT_CFM_FUNCTION SRNewLanguageModel
  437.     ENDIF
  438.  
  439. ;
  440. ; pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  441. ;
  442.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  443.         Macro
  444.         _SRNewPath
  445.             move.w              #$0413,D0
  446.             dc.w                $AA56
  447.         EndM
  448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION SRNewPath
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  454. ;
  455.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  456.         Macro
  457.         _SRNewPhrase
  458.             move.w              #$0814,D0
  459.             dc.w                $AA56
  460.         EndM
  461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION SRNewPhrase
  463.     ENDIF
  464.  
  465. ;
  466. ; pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  467. ;
  468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  469.         Macro
  470.         _SRNewWord
  471.             move.w              #$0815,D0
  472.             dc.w                $AA56
  473.         EndM
  474.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION SRNewWord
  476.     ENDIF
  477.  
  478. ;  Operations on any object of the SRLanguageObject family 
  479. ;
  480. ; pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject languageObject, Handle lobjHandle)
  481. ;
  482.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  483.         Macro
  484.         _SRPutLanguageObjectIntoHandle
  485.             move.w              #$0416,D0
  486.             dc.w                $AA56
  487.         EndM
  488.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  489.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoHandle
  490.     ENDIF
  491.  
  492. ;
  493. ; pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject languageObject, short fRefNum)
  494. ;
  495.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  496.         Macro
  497.         _SRPutLanguageObjectIntoDataFile
  498.             move.w              #$0328,D0
  499.             dc.w                $AA56
  500.         EndM
  501.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  502.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoDataFile
  503.     ENDIF
  504.  
  505. ;
  506. ; pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *languageObject, Handle lObjHandle)
  507. ;
  508.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  509.         Macro
  510.         _SRNewLanguageObjectFromHandle
  511.             move.w              #$0417,D0
  512.             dc.w                $AA56
  513.         EndM
  514.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  515.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromHandle
  516.     ENDIF
  517.  
  518. ;
  519. ; pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *languageObject, short fRefNum)
  520. ;
  521.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  522.         Macro
  523.         _SRNewLanguageObjectFromDataFile
  524.             move.w              #$0427,D0
  525.             dc.w                $AA56
  526.         EndM
  527.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  528.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromDataFile
  529.     ENDIF
  530.  
  531. ;
  532. ; pascal OSErr SREmptyLanguageObject(SRLanguageObject languageObject)
  533. ;
  534.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  535.         Macro
  536.         _SREmptyLanguageObject
  537.             move.w              #$0218,D0
  538.             dc.w                $AA56
  539.         EndM
  540.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  541.         IMPORT_CFM_FUNCTION SREmptyLanguageObject
  542.     ENDIF
  543.  
  544. ;
  545. ; pascal OSErr SRChangeLanguageObject(SRLanguageObject languageObject, const void *text, Size textLength)
  546. ;
  547.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  548.         Macro
  549.         _SRChangeLanguageObject
  550.             move.w              #$0619,D0
  551.             dc.w                $AA56
  552.         EndM
  553.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  554.         IMPORT_CFM_FUNCTION SRChangeLanguageObject
  555.     ENDIF
  556.  
  557. ;
  558. ; pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  559. ;
  560.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  561.         Macro
  562.         _SRAddLanguageObject
  563.             move.w              #$041A,D0
  564.             dc.w                $AA56
  565.         EndM
  566.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  567.         IMPORT_CFM_FUNCTION SRAddLanguageObject
  568.     ENDIF
  569.  
  570. ;
  571. ; pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  572. ;
  573.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  574.         Macro
  575.         _SRAddText
  576.             move.w              #$081B,D0
  577.             dc.w                $AA56
  578.         EndM
  579.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  580.         IMPORT_CFM_FUNCTION SRAddText
  581.     ENDIF
  582.  
  583. ;
  584. ; pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  585. ;
  586.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  587.         Macro
  588.         _SRRemoveLanguageObject
  589.             move.w              #$041C,D0
  590.             dc.w                $AA56
  591.         EndM
  592.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  593.         IMPORT_CFM_FUNCTION SRRemoveLanguageObject
  594.     ENDIF
  595.  
  596. ;  Traversing SRRecognitionResults or SRLanguageObjects 
  597. ;
  598. ; pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  599. ;
  600.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  601.         Macro
  602.         _SRCountItems
  603.             move.w              #$0405,D0
  604.             dc.w                $AA56
  605.         EndM
  606.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  607.         IMPORT_CFM_FUNCTION SRCountItems
  608.     ENDIF
  609.  
  610. ;
  611. ; pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  614.         Macro
  615.         _SRGetIndexedItem
  616.             move.w              #$0606,D0
  617.             dc.w                $AA56
  618.         EndM
  619.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  620.         IMPORT_CFM_FUNCTION SRGetIndexedItem
  621.     ENDIF
  622.  
  623. ;
  624. ; pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  625. ;
  626.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  627.         Macro
  628.         _SRSetIndexedItem
  629.             move.w              #$0607,D0
  630.             dc.w                $AA56
  631.         EndM
  632.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  633.         IMPORT_CFM_FUNCTION SRSetIndexedItem
  634.     ENDIF
  635.  
  636. ;
  637. ; pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  638. ;
  639.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  640.         Macro
  641.         _SRRemoveIndexedItem
  642.             move.w              #$0408,D0
  643.             dc.w                $AA56
  644.         EndM
  645.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  646.         IMPORT_CFM_FUNCTION SRRemoveIndexedItem
  647.     ENDIF
  648.  
  649. ;  Utilizing the System Feedback Window 
  650. ;
  651. ; pascal OSErr SRDrawText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  652. ;
  653.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  654.         Macro
  655.         _SRDrawText
  656.             move.w              #$0621,D0
  657.             dc.w                $AA56
  658.         EndM
  659.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  660.         IMPORT_CFM_FUNCTION SRDrawText
  661.     ENDIF
  662.  
  663. ;
  664. ; pascal OSErr SRDrawRecognizedText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  665. ;
  666.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  667.         Macro
  668.         _SRDrawRecognizedText
  669.             move.w              #$0622,D0
  670.             dc.w                $AA56
  671.         EndM
  672.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  673.         IMPORT_CFM_FUNCTION SRDrawRecognizedText
  674.     ENDIF
  675.  
  676. ;
  677. ; pascal OSErr SRSpeakText(SRRecognizer recognizer, const void *speakText, Size speakLength)
  678. ;
  679.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  680.         Macro
  681.         _SRSpeakText
  682.             move.w              #$0620,D0
  683.             dc.w                $AA56
  684.         EndM
  685.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  686.         IMPORT_CFM_FUNCTION SRSpeakText
  687.     ENDIF
  688.  
  689. ;
  690. ; pascal OSErr SRSpeakAndDrawText(SRRecognizer recognizer, const void *text, Size textLength)
  691. ;
  692.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  693.         Macro
  694.         _SRSpeakAndDrawText
  695.             move.w              #$061F,D0
  696.             dc.w                $AA56
  697.         EndM
  698.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  699.         IMPORT_CFM_FUNCTION SRSpeakAndDrawText
  700.     ENDIF
  701.  
  702. ;
  703. ; pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  704. ;
  705.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  706.         Macro
  707.         _SRStopSpeech
  708.             move.w              #$0223,D0
  709.             dc.w                $AA56
  710.         EndM
  711.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  712.         IMPORT_CFM_FUNCTION SRStopSpeech
  713.     ENDIF
  714.  
  715. ;
  716. ; pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  717. ;
  718.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  719.         Macro
  720.         _SRSpeechBusy
  721.             move.w              #$0224,D0
  722.             dc.w                $AA56
  723.         EndM
  724.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  725.         IMPORT_CFM_FUNCTION SRSpeechBusy
  726.     ENDIF
  727.  
  728. ;
  729. ; pascal OSErr SRProcessBegin(SRRecognizer recognizer, Boolean failed)
  730. ;
  731.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  732.         Macro
  733.         _SRProcessBegin
  734.             move.w              #$031D,D0
  735.             dc.w                $AA56
  736.         EndM
  737.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  738.         IMPORT_CFM_FUNCTION SRProcessBegin
  739.     ENDIF
  740.  
  741. ;
  742. ; pascal OSErr SRProcessEnd(SRRecognizer recognizer, Boolean failed)
  743. ;
  744.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  745.         Macro
  746.         _SRProcessEnd
  747.             move.w              #$031E,D0
  748.             dc.w                $AA56
  749.         EndM
  750.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  751.         IMPORT_CFM_FUNCTION SRProcessEnd
  752.     ENDIF
  753.  
  754.  
  755.  
  756.     ENDIF ; __SPEECHRECOGNITION__ 
  757.  
  758.